import {FormProps, FormSchema} from '/@/components/Table';

import {BasicColumn} from '/@/components/Table/src/types/table';
import {Tag} from "ant-design-vue";
import {h} from 'vue';
import { dateUtil } from '/@/utils/dateUtil';


//表格显示列
export function getBasicColumns(): BasicColumn[] {
  // @ts-ignore
  return [

    {
      title: '学员姓名',
      dataIndex: 'realName',
      width: 60,

    },{
      title: '手机号',
      dataIndex: 'phoneNo',
      width: 60,

    },
    {
      title: '身份证',
      dataIndex: 'idCardNo',
      width: 100,
    },
    {
      title: '课程名称',
      dataIndex: 'title',
      width: 200,
    },
    {
      title: '订单创建时间',
      dataIndex: 'createTime',
      width: 100,
      customRender: ({record}) => {
        let val = record.createTime;
        console.log(val)
        return val ? dateUtil(val).format('YYYY-MM-DD HH:mm:ss') : ''
      },
    },
    {
      title: '订单支付时间',
      dataIndex: 'modeifyTime',
      width: 100,
      customRender: ({record}) => {
        let val = record.modeifyTime;
        console.log(val)
        return val ? dateUtil(val).format('YYYY-MM-DD HH:mm:ss') : ''
      },
    },
    {
      title: '金额',
      dataIndex: 'money',
      width: 50,
    },
    {
      title: '支付方式',
      dataIndex: 'payType',
      width: 50,
      },


  ];
}

export function getFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 150,
    baseColProps: {lg: 6, md: 24},
    schemas: formParamSchema,
  };
}



//查询条件表单
export const formParamSchema: FormSchema[] = [
  {
    field: 'name',
    label: '姓名',
    component: 'Input',
  },{
    field: 'phone',
    label: '手机号',
    component: 'Input',
  },{
    field: 'idNoCard',
    label: '身份证号',
    component: 'Input',
  },

];


